﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using MPR.Poker.Model.LIS;

namespace PokerLife.Models.LIS
{
    public class CountryViewModel
    {
        [ScaffoldColumn(false)]
        public int IDSys { get; set; }

        [Display(Name = "CountryID")]
        [Required(ErrorMessage = "Import Country ID")]
        public string CountryID { get; set; }

        [Display(Name = "Country")]
        [Required(ErrorMessage = "Import Country")]
        public string CountryName { get; set; }

        [Display(Name = "Abbreviation Name")]
        public string AbbreviationName { get; set; }

        [Display(Name = "Note")]
        public string Note { get; set; }

        public static LIS_Country ConvertTo(PokerLife.Models.LIS.CountryViewModel obj)
        {
            LIS_Country objCountry = new LIS_Country();
            objCountry.CountryID = obj.CountryID;
            objCountry.CountryName = obj.CountryName;
            objCountry.AbbreviationName = obj.AbbreviationName;
            objCountry.Note = obj.Note;
            objCountry.IDSys = obj.IDSys;
            return objCountry;
        }

        public static PokerLife.Models.LIS.CountryViewModel ConvertToModel(LIS_Country obj)
        {
            PokerLife.Models.LIS.CountryViewModel objCountry = new PokerLife.Models.LIS.CountryViewModel();
            objCountry.CountryID = obj.CountryID;
            objCountry.CountryName = obj.CountryName;
            objCountry.AbbreviationName = obj.AbbreviationName;
            objCountry.Note = obj.Note;
            objCountry.IDSys = obj.IDSys;
            return objCountry;
        }
    }
}